<template>
  <div style="height: 100%">
    <div class="content">
      <div class="header">
        <el-tabs v-model="activeName" @tab-click="handleClick">
          <el-tab-pane label="客户分组设置" name="first">
            <group-list ref="group"></group-list>
          </el-tab-pane>
          <el-tab-pane label="标签设置" name="second">
            <mark-list ref="mark"></mark-list>
          </el-tab-pane>
          <el-tab-pane label="客户导入" name="third">
            <importList ref="temList"></importList>
          </el-tab-pane>
        </el-tabs>
      </div>
    </div>
  </div>
</template>

<script>
    import groupList from '@/components/customer/statistics/groupList.vue'
    import importList from "@/components/customer/importList";
    import markList from "@/components/customer/statistics/mark.vue";

    export default {
        name: 'home',
        data() {
            return {
                activeName: this.$route.params.type == 3 ? 'third' : 'first'
            };
        },
        mounted() {
            if(this.$route.params.type == 3) {
                this.$refs.temList.init()
            }
        },
        methods: {
            handleClick(tab) {
                switch (tab.name) {
                    case 'first': // 请求分组设置
                        this.$refs.group.init()
                        break;
                    case 'second': // 标签设置
                        this.$refs.mark.init()
                        break;
                    case 'third': // 客户导入
                        this.$refs.temList.init()
                        break;
                }
            }
        },
        components: {
            groupList,
            importList,
            markList
        }
    }
</script>
<style lang="scss">
  .el-scrollbar__view {
    height: 100%;
  }

  .tag {
    .el-icon-close {
      color: white !important;
    }
  }
  .group-footer .dialog-footer{
    text-align: center;
  }

</style>


<style lang="scss" scoped>
  .content {
    padding: 10px 21px;
    box-sizing: border-box;
    height: 100%;
    overflow: auto;
    background: white;
    font-size: 13px;
  }
  .group_title{
    font-weight: 600;
    font-size: 16px;
  }

  .header {
    position: relative
  }

  .addBtn {
    position: absolute;
    right: 20px;
    top: -55px
  }

  .list {
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* padding-right 20px; */
    padding: 20px;
    box-sizing: border-box;
    border-bottom: 2px solid #F3F3F3;
    position: relative;
  }

  .list:hover {
    background: #E9F3FD;
  }

  .icon {
    font-size: 22px;
    width: 130px;
    display: flex;
    justify-content: space-around;
  }

  .title {
    text-align: center;
    color: #409eff;
    font-size: 15px;
    margin-bottom: 20px;
  }

  .flex {
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
  }

  .colorItem {
    width: 16px;
    height: 16px;
    border-radius: 2px;
    float: left;
    margin: 0 4px 4px 0;
    cursor: pointer;
    text-align: center;
    color: white;
    box-sizing: border-box;
    line-height: 16px;
  }

  .colorList {
    width: 120px;
    height: 60px;
    padding: 12px;
    border: 1px solid #d9dbdd;
    border-radius: 4px;
    position: absolute;
    right: -80px;
    top: 40px;
    background: white;
  }

  .el-icon-check:before {
    margin-top: 2px;
  }

  .label_btn {
    color: white;
    display: inline-block;
    padding: 9px 15px;
    font-size: 12px;
    border-radius: 8px;
    cursor: default;
  }
</style>


